/*    */ package com.wgcloud.util;
/*    */ 
/*    */ import com.wgcloud.dto.TuopuNodeDto;
/*    */ import java.util.List;
/*    */ 
/*    */ 
/*    */ public class TuopuUtil
/*    */ {
/*    */   public static void initList(List<TuopuNodeDto> list) {
/* 10 */     int centerX = 760;
/* 11 */     int centerY = 520;
/* 12 */     int radius = getRadius(list.size());
/* 13 */     int count = list.size();
/*    */     
/* 15 */     for (int i = 0; i < list.size(); i++) {
/* 16 */       int x = centerX + (int)(radius * Math.cos(6.283185307179586D / count * i));
/* 17 */       int y = centerY + (int)(radius * Math.sin(6.283185307179586D / count * i));
/*    */       
/* 19 */       ((TuopuNodeDto)list.get(i)).setX(x);
/* 20 */       ((TuopuNodeDto)list.get(i)).setY(y);
/*    */     } 
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   public static int getRadius(int count) {
/* 28 */     if (count == 1) {
/* 29 */       count = 2;
/*    */     }
/* 31 */     double disitem = 360.0D / count;
/* 32 */     double minr = 5.0D / Math.sin(0.5D * disitem * Math.PI / 180.0D);
/* 33 */     double noder = minr * 1.5D + 15.0D + 80.0D;
/* 34 */     if (noder < 260.0D) {
/* 35 */       noder = 260.0D;
/*    */     }
/* 37 */     return Integer.valueOf(String.valueOf(noder).substring(0, String.valueOf(noder).indexOf("."))).intValue();
/*    */   }
/*    */ }


/* Location:              /Users/zhangyongxin/soft-install/wgcloud/wgcloud-v3.3.5/server/bank/wgcloud-server-release.jar!/BOOT-INF/classes/com/wgcloud/util/TuopuUtil.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */